import request from "@/request";
import ResultEnum from "@/config/ResultEnum";

export interface FormValue {
  roleName: string | undefined;
  roleKey: string | undefined;
  orderNum: string | undefined;
}

export const submit = (data: any) => {
  return new Promise((resolve: any, reject: any) => {
    request({
      url: "/dashboard/role/add",
      method: "post",
      data,
    }).then((res: any) => {
      if (res.code == ResultEnum.SUCCESS_CODE) {
        resolve(res.result);
      } else {
        reject(res.message);
      }
    });
  });
};
